package com.ccnf.model.enums;

public enum RoleTypeEnum {
    USER(0),// 用户
    EXHIBITOR(1),// 展商
    MANAGER(2),// 管理员
    MASTER(3);// 主办

    private Integer roleType;

    RoleTypeEnum(Integer roleType) {
        this.roleType = roleType;
    }

    public Integer getRoleType() {
        return this.roleType;
    }

    public static RoleTypeEnum valueOf(Integer roleType) {
        RoleTypeEnum roleTypeEnum;
        switch (roleType) {
            case 0:
                roleTypeEnum = USER;
                break;
            case 1:
                roleTypeEnum = EXHIBITOR;
                break;
            case 2:
                roleTypeEnum = MANAGER;
                break;
            case 3:
                roleTypeEnum = MASTER;
                break;
            default:
                throw new RuntimeException("不存在该枚举类型");
        }
        return roleTypeEnum;
    }
}